/*
 * Copyright 2018 JDCLOUD.COM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * 京东云内容安全-OpenAPI接口
 * 京东云内容安全-OpenAPI接口
 *
 * OpenAPI spec version: v1
 * Contact: 
 *
 * NOTE: This class is auto generated by the jdcloud code generator program.
 */


using JDCloudSDK.Core.Auth;
using JDCloudSDK.Core.Client;
using JDCloudSDK.Core.Http;
using JDCloudSDK.Censor.Apis;
using JDCloudSDK.Censor.Model;
using System;
using System.Collections.Generic;
using System.Text;
#if NET40||NET35
#else
using System.Threading.Tasks;
#endif

namespace JDCloudSDK.Censor.Client
{
    /// <summary>
    ///  京东云内容安全-OpenAPI接口
    ///  京东云内容安全-OpenAPI接口
    ///  Censor Api 客户端
    ///</summary>
    public class CensorClient : JdcloudClient
    {

        /// <summary>
        ///  默认私有构造函数
        /// </summary>
        private CensorClient()
        {

        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="environment">sdk 环境配置信息</param>
        public CensorClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig,SDKEnvironment environment)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
            this.environment = environment;
        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="credentialsProvider">认证信息</param>
        public CensorClient(CredentialsProvider credentialsProvider,HttpRequestConfig httpRequestConfig)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        /// 默认构造函数，
        /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        public CensorClient(CredentialsProvider credentialsProvider)
        {
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        ///  版本号 1.2.3
        ///</summary>
        public const string ClientVersion = "1.2.3";

        private const string apiVersion = "v1";
        private const string userAgentPrefix = "JdcloudSdkDotNet";
        private const string defaultEndpoint = "censor.jdcloud-api.com";
        private const string serviceName = "censor";
        private const string userAgent = userAgentPrefix + "/" + ClientVersion + " " + serviceName + "/" + apiVersion;


        private SDKEnvironment environment = new SDKEnvironment(defaultEndpoint);
        private CredentialsProvider credentialsProvider;
        private HttpRequestConfig httpRequestConfig;

        /// <summary>
        ///  获取证书信息
        ///</summary>
        public override CredentialsProvider CredentialsProvider   { get { return credentialsProvider; } }

        /// <summary>
        ///  获取http 客户端配置信息
        ///</summary>
        public override HttpRequestConfig HttpRequestConfig { get { return httpRequestConfig; } }

        /// <summary>
        ///  获取sdk环境配置信息
        ///</summary>
        public override SDKEnvironment SDKEnvironment { get { return environment; } }

        /// <summary>
        ///  获取用户自定义浏览器识别字符串
        ///</summary>
        public override string UserAgent { get { return userAgent; } }

        /// <summary>
        ///  获取服务名称
        ///</summary>
        public override string ServiceName { get { return serviceName; } }

        /// <summary>
        ///  获取版本号
        ///</summary>
        public override string Version { get { return apiVersion; } }



#if NET40||NET35
        /// <summary>
        ///  查看音频异步检测结果
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AudioResultsResponse AudioResults(AudioResultsRequest request) {
            return  new AudioResultsExecutor().Client(this).Execute<AudioResultsResponse, AudioResultsResult, AudioResultsRequest>(request);
        }
#else
        /// <summary>
        ///  查看音频异步检测结果
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AudioResultsResponse> AudioResults(AudioResultsRequest request) {
            return await new AudioResultsExecutor().Client(this).Execute<AudioResultsResponse, AudioResultsResult, AudioResultsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除限制参数配置
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteLimitResponse DeleteLimit(DeleteLimitRequest request) {
            return  new DeleteLimitExecutor().Client(this).Execute<DeleteLimitResponse, DeleteLimitResult, DeleteLimitRequest>(request);
        }
#else
        /// <summary>
        ///  删除限制参数配置
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteLimitResponse> DeleteLimit(DeleteLimitRequest request) {
            return await new DeleteLimitExecutor().Client(this).Execute<DeleteLimitResponse, DeleteLimitResult, DeleteLimitRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  提交音频异步检测任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AsyncAudioScanResponse AsyncAudioScan(AsyncAudioScanRequest request) {
            return  new AsyncAudioScanExecutor().Client(this).Execute<AsyncAudioScanResponse, AsyncAudioScanResult, AsyncAudioScanRequest>(request);
        }
#else
        /// <summary>
        ///  提交音频异步检测任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AsyncAudioScanResponse> AsyncAudioScan(AsyncAudioScanRequest request) {
            return await new AsyncAudioScanExecutor().Client(this).Execute<AsyncAudioScanResponse, AsyncAudioScanResult, AsyncAudioScanRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  提交音频异步检测任务V2
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AsyncAudioScanV2Response AsyncAudioScanV2(AsyncAudioScanV2Request request) {
            return  new AsyncAudioScanV2Executor().Client(this).Execute<AsyncAudioScanV2Response, AsyncAudioScanV2Result, AsyncAudioScanV2Request>(request);
        }
#else
        /// <summary>
        ///  提交音频异步检测任务V2
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AsyncAudioScanV2Response> AsyncAudioScanV2(AsyncAudioScanV2Request request) {
            return await new AsyncAudioScanV2Executor().Client(this).Execute<AsyncAudioScanV2Response, AsyncAudioScanV2Result, AsyncAudioScanV2Request>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查看图片异步检测结果
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ImageResultsResponse ImageResults(ImageResultsRequest request) {
            return  new ImageResultsExecutor().Client(this).Execute<ImageResultsResponse, ImageResultsResult, ImageResultsRequest>(request);
        }
#else
        /// <summary>
        ///  查看图片异步检测结果
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ImageResultsResponse> ImageResults(ImageResultsRequest request) {
            return await new ImageResultsExecutor().Client(this).Execute<ImageResultsResponse, ImageResultsResult, ImageResultsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除敏感库
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteCensorLibResponse DeleteCensorLib(DeleteCensorLibRequest request) {
            return  new DeleteCensorLibExecutor().Client(this).Execute<DeleteCensorLibResponse, DeleteCensorLibResult, DeleteCensorLibRequest>(request);
        }
#else
        /// <summary>
        ///  删除敏感库
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteCensorLibResponse> DeleteCensorLib(DeleteCensorLibRequest request) {
            return await new DeleteCensorLibExecutor().Client(this).Execute<DeleteCensorLibResponse, DeleteCensorLibResult, DeleteCensorLibRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  文本同步检测-检测文本中是否包含违规信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public TextScanResponse TextScan(TextScanRequest request) {
            return  new TextScanExecutor().Client(this).Execute<TextScanResponse, TextScanResult, TextScanRequest>(request);
        }
#else
        /// <summary>
        ///  文本同步检测-检测文本中是否包含违规信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<TextScanResponse> TextScan(TextScanRequest request) {
            return await new TextScanExecutor().Client(this).Execute<TextScanResponse, TextScanResult, TextScanRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查看文本疑似结果，小于10s/20次，请求频率过快服务器会拒绝处理
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public TextResultsV2Response TextResultsV2(TextResultsV2Request request) {
            return  new TextResultsV2Executor().Client(this).Execute<TextResultsV2Response, TextResultsV2Result, TextResultsV2Request>(request);
        }
#else
        /// <summary>
        ///  查看文本疑似结果，小于10s/20次，请求频率过快服务器会拒绝处理
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<TextResultsV2Response> TextResultsV2(TextResultsV2Request request) {
            return await new TextResultsV2Executor().Client(this).Execute<TextResultsV2Response, TextResultsV2Result, TextResultsV2Request>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除敏感库Item
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteCensorLibItemsResponse DeleteCensorLibItems(DeleteCensorLibItemsRequest request) {
            return  new DeleteCensorLibItemsExecutor().Client(this).Execute<DeleteCensorLibItemsResponse, DeleteCensorLibItemsResult, DeleteCensorLibItemsRequest>(request);
        }
#else
        /// <summary>
        ///  删除敏感库Item
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteCensorLibItemsResponse> DeleteCensorLibItems(DeleteCensorLibItemsRequest request) {
            return await new DeleteCensorLibItemsExecutor().Client(this).Execute<DeleteCensorLibItemsResponse, DeleteCensorLibItemsResult, DeleteCensorLibItemsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  提交图片异步检测任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AsyncImageScanResponse AsyncImageScan(AsyncImageScanRequest request) {
            return  new AsyncImageScanExecutor().Client(this).Execute<AsyncImageScanResponse, AsyncImageScanResult, AsyncImageScanRequest>(request);
        }
#else
        /// <summary>
        ///  提交图片异步检测任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AsyncImageScanResponse> AsyncImageScan(AsyncImageScanRequest request) {
            return await new AsyncImageScanExecutor().Client(this).Execute<AsyncImageScanResponse, AsyncImageScanResult, AsyncImageScanRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  根据taskid查询视频检测结果，小于10s/20次，请求频率过快服务器会拒绝处理
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public VideoResultsV2Response VideoResultsV2(VideoResultsV2Request request) {
            return  new VideoResultsV2Executor().Client(this).Execute<VideoResultsV2Response, VideoResultsV2Result, VideoResultsV2Request>(request);
        }
#else
        /// <summary>
        ///  根据taskid查询视频检测结果，小于10s/20次，请求频率过快服务器会拒绝处理
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<VideoResultsV2Response> VideoResultsV2(VideoResultsV2Request request) {
            return await new VideoResultsV2Executor().Client(this).Execute<VideoResultsV2Response, VideoResultsV2Result, VideoResultsV2Request>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  图片同步检测
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ImageScanResponse ImageScan(ImageScanRequest request) {
            return  new ImageScanExecutor().Client(this).Execute<ImageScanResponse, ImageScanResult, ImageScanRequest>(request);
        }
#else
        /// <summary>
        ///  图片同步检测
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ImageScanResponse> ImageScan(ImageScanRequest request) {
            return await new ImageScanExecutor().Client(this).Execute<ImageScanResponse, ImageScanResult, ImageScanRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  语音检测结果获取接口，获取离线处理的数据后，下次调用，不会再次返回之前获取过的离线数据。小于10s/20次，请求频率过快服务器会拒绝处理
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AudioCallbackV2Response AudioCallbackV2(AudioCallbackV2Request request) {
            return  new AudioCallbackV2Executor().Client(this).Execute<AudioCallbackV2Response, AudioCallbackV2Result, AudioCallbackV2Request>(request);
        }
#else
        /// <summary>
        ///  语音检测结果获取接口，获取离线处理的数据后，下次调用，不会再次返回之前获取过的离线数据。小于10s/20次，请求频率过快服务器会拒绝处理
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AudioCallbackV2Response> AudioCallbackV2(AudioCallbackV2Request request) {
            return await new AudioCallbackV2Executor().Client(this).Execute<AudioCallbackV2Response, AudioCallbackV2Result, AudioCallbackV2Request>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  文本同步检测-检测文本中是否包含违规信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public InnerTextScanResponse InnerTextScan(InnerTextScanRequest request) {
            return  new InnerTextScanExecutor().Client(this).Execute<InnerTextScanResponse, InnerTextScanResult, InnerTextScanRequest>(request);
        }
#else
        /// <summary>
        ///  文本同步检测-检测文本中是否包含违规信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<InnerTextScanResponse> InnerTextScan(InnerTextScanRequest request) {
            return await new InnerTextScanExecutor().Client(this).Execute<InnerTextScanResponse, InnerTextScanResult, InnerTextScanRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查看视频异步检测结果
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public VideoResultsResponse VideoResults(VideoResultsRequest request) {
            return  new VideoResultsExecutor().Client(this).Execute<VideoResultsResponse, VideoResultsResult, VideoResultsRequest>(request);
        }
#else
        /// <summary>
        ///  查看视频异步检测结果
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<VideoResultsResponse> VideoResults(VideoResultsRequest request) {
            return await new VideoResultsExecutor().Client(this).Execute<VideoResultsResponse, VideoResultsResult, VideoResultsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  提交视频异步检测任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AsyncVideoScanResponse AsyncVideoScan(AsyncVideoScanRequest request) {
            return  new AsyncVideoScanExecutor().Client(this).Execute<AsyncVideoScanResponse, AsyncVideoScanResult, AsyncVideoScanRequest>(request);
        }
#else
        /// <summary>
        ///  提交视频异步检测任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AsyncVideoScanResponse> AsyncVideoScan(AsyncVideoScanRequest request) {
            return await new AsyncVideoScanExecutor().Client(this).Execute<AsyncVideoScanResponse, AsyncVideoScanResult, AsyncVideoScanRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  视频检测结果获取接口，获取离线处理的数据后，下次调用，不会再次返回之前获取过的离线数据。小于10s/20次，请求频率过快服务器会拒绝处理
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public VideoCallbackV2Response VideoCallbackV2(VideoCallbackV2Request request) {
            return  new VideoCallbackV2Executor().Client(this).Execute<VideoCallbackV2Response, VideoCallbackV2Result, VideoCallbackV2Request>(request);
        }
#else
        /// <summary>
        ///  视频检测结果获取接口，获取离线处理的数据后，下次调用，不会再次返回之前获取过的离线数据。小于10s/20次，请求频率过快服务器会拒绝处理
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<VideoCallbackV2Response> VideoCallbackV2(VideoCallbackV2Request request) {
            return await new VideoCallbackV2Executor().Client(this).Execute<VideoCallbackV2Response, VideoCallbackV2Result, VideoCallbackV2Request>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  根据taskid查询语音检测结果，小于10s/20次，请求频率过快服务器会拒绝处理
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AudioResultsV2Response AudioResultsV2(AudioResultsV2Request request) {
            return  new AudioResultsV2Executor().Client(this).Execute<AudioResultsV2Response, AudioResultsV2Result, AudioResultsV2Request>(request);
        }
#else
        /// <summary>
        ///  根据taskid查询语音检测结果，小于10s/20次，请求频率过快服务器会拒绝处理
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AudioResultsV2Response> AudioResultsV2(AudioResultsV2Request request) {
            return await new AudioResultsV2Executor().Client(this).Execute<AudioResultsV2Response, AudioResultsV2Result, AudioResultsV2Request>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  提交视频异步检测任务V2
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AsyncVideoScanV2Response AsyncVideoScanV2(AsyncVideoScanV2Request request) {
            return  new AsyncVideoScanV2Executor().Client(this).Execute<AsyncVideoScanV2Response, AsyncVideoScanV2Result, AsyncVideoScanV2Request>(request);
        }
#else
        /// <summary>
        ///  提交视频异步检测任务V2
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AsyncVideoScanV2Response> AsyncVideoScanV2(AsyncVideoScanV2Request request) {
            return await new AsyncVideoScanV2Executor().Client(this).Execute<AsyncVideoScanV2Response, AsyncVideoScanV2Result, AsyncVideoScanV2Request>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  图片同步检测v2
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ImageScanV2Response ImageScanV2(ImageScanV2Request request) {
            return  new ImageScanV2Executor().Client(this).Execute<ImageScanV2Response, ImageScanV2Result, ImageScanV2Request>(request);
        }
#else
        /// <summary>
        ///  图片同步检测v2
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ImageScanV2Response> ImageScanV2(ImageScanV2Request request) {
            return await new ImageScanV2Executor().Client(this).Execute<ImageScanV2Response, ImageScanV2Result, ImageScanV2Request>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  文本同步检测-检测文本中是否包含违规信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public TextScanV2Response TextScanV2(TextScanV2Request request) {
            return  new TextScanV2Executor().Client(this).Execute<TextScanV2Response, TextScanV2Result, TextScanV2Request>(request);
        }
#else
        /// <summary>
        ///  文本同步检测-检测文本中是否包含违规信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<TextScanV2Response> TextScanV2(TextScanV2Request request) {
            return await new TextScanV2Executor().Client(this).Execute<TextScanV2Response, TextScanV2Result, TextScanV2Request>(request).ConfigureAwait(false);
        }
#endif

            /// <summary>
            ///  默认CensorClient 构造器 接口
            ///</summary>
            public interface Builder
            {

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>censorClient 构造器</returns>
                Builder CredentialsProvider(CredentialsProvider provider);

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>censorClient 构造器</returns>
                Builder Environment(Core.Client.SDKEnvironment environment);

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>censorClient 构造器</returns>
                Builder HttpRequestConfig(HttpRequestConfig config);

                /// <summary>
                ///  构造CensorClient 对象
                ///</summary>
                CensorClient Build();
            }

            /// <summary>
            ///  默认CensorClient 构造器
            ///</summary>
            public class DefaultBuilder : Builder
            {
                /// <summary>
                ///  CensorClient service client
                /// </summary>
                private  CensorClient censorClient;

                /// <summary>
                ///  默认CensorClient 构造器构造对象
                ///</summary>
                public DefaultBuilder()
                {
                    censorClient = new CensorClient();
                }

                /// <summary>
                ///  构造CensorClient 对象
                ///</summary>
                public CensorClient Build()
                {
                    if (censorClient.CredentialsProvider == null)
                    {
                        //if credentialsProvider not set, try load jdcloud global default  credentials provider
                        censorClient.credentialsProvider = JdCloud.DefaultInstance.GetCredentialsProvider();
                        if (censorClient.credentialsProvider == null)
                        {
                            throw new ArgumentNullException("CensorClient build error: jdcloud credentials provider not set");
                        }
                    }
                    if (censorClient.HttpRequestConfig == null)
                    {
                        censorClient.httpRequestConfig = JdCloud.DefaultInstance.GetHttpRequestConfig();
                        if (censorClient.httpRequestConfig == null)
                        {
                        throw new ArgumentNullException("CensorClient build error: http request config not set");
                        }
                    }
                    return censorClient;
                }

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>censorClient 构造器</returns>
                public Builder CredentialsProvider(CredentialsProvider provider)
                {
                    censorClient.credentialsProvider = provider;
                    return this;
                }

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>censorClient 构造器</returns>
                public Builder Environment(SDKEnvironment environment)
                {
                    censorClient.environment = environment;
                    return this;
                }

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>censorClient 构造器</returns>
                public Builder HttpRequestConfig(HttpRequestConfig config)
                {
                    censorClient.httpRequestConfig = config;
                    return this;
                }
            }
    }
}
